<?PHP
require_once('config.inc.php');
require_once('Classes/ImageManager.php');

require_once ($_SERVER['DOCUMENT_ROOT']."/config/phpwcms/conf.inc.php");
	
$manager = new ImageManager($IMConfig);
$dirs = $manager->getDirs();
	
	function get_bild($nr,$value,$width,$height) {

	$value = explode(":", $value);

	$bild = "<input name=\"cimage_name".$nr."\" type=\"text\" id=\"cimage_name".$nr."\" class=\"f11b\" style=\"\" value=\"".$value[0]."\" size=\"20\" maxlength=\"150\" onFocus=\"this.blur()\">&nbsp;\n";
	$bild .= "<a href=\"javascript:;\" title=\"Bildbrowser &ouml;ffnen\" onClick=\"tmt_winOpen('filebrowser_exd.php?nr=".$nr."','imageBrowser','width=380,height=300,left=8,top=8,scrollbars=yes,resizable=yes',1)\"><img src=\"img/open_image_button.gif\" width=\"20\" height=\"15\" border=\"0\"></a>&nbsp;\n";
	$bild .= "<a href=\"javascript:;\" alt=\"Gew&auml;hltes Bild entfernen\" onClick=\"document.art.cimage_name".$nr.".value='';document.art.cimage_id".$nr.".value='0';this.blur();return false;\"><img src=\"img/del_image_button.gif\" width=\"15\" height=\"15\" border=\"0\"></a>&nbsp;\n";
	$bild .= "".$width."&nbsp;<input name=\"cimage_x".$nr."\" type=\"text\" id=\"cimage_x".$nr."\" class=\"f11b\" value=\"".$value[2]."\" size=\"3\" maxlength=\"10\">&nbsp;\n";
	$bild .= "".$height."&nbsp;<input name=\"cimage_y".$nr."\" type=\"text\" id=\"cimage_y".$nr."\" class=\"f11b\" value=\"".$value[3]."\" size=\"3\" maxlength=\"10\">&nbsp;\n";
	$bild .= "<input name=\"cimage_id".$nr."\" type=\"hidden\" value=\"".$value[1]."\">\n";
		  return $bild;
	}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Insert Image</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="assets/manager.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="assets/popup.js"></script>
<script type="text/javascript" src="assets/dialog.js"></script>
<script language="javascript" src="<? $_SERVER['DOCUMENT_ROOT']?> /include/inc_js/phpwcms.js" type="text/javascript"></script>
<script type="text/javascript">
			/*<![CDATA[*/
			window.resizeTo(600, 350);
		
			if(window.opener)
				I18N = window.opener.ImageManager.I18N;
		
			var thumbdir = "<?php echo $IMConfig['thumbnail_dir']; ?>";
			var base_url = "<?php echo $manager->getBaseURL(); ?>";
			var server_name = "<?php echo $IMConfig['server_name']; ?>";
		
			/*]]>*/
		</script>
<script type="text/javascript" src="assets/manager.js"></script>
</head>
<body>
<div class="title">phpWCMS Insert Image</div>
<!--		<form action="images.php" id="uploadForm" method="post" enctype="multipart/form-data">
			<fieldset><legend>phpWCMS Image Manager</legend>
			<div class="dirs">
					<div id="messages" style="display: none;">
						<span id="message"></span>
						<img SRC="img/dots.gif" width="22" height="12" alt="..." />
					</div>
					<iframe src="img.php" name="img" id="img" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe> 
				</div>
			</fieldset>/-->
<!-- image properties -->
<table class="inputTable">
  <tr>
    <td align="right"><label for="f_name">Image Name</label></td>
    <td colspan="5">
	   <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post" name="art" id="art">
<!--	     <input type="hidden" name="id" value="<?php echo $values['id']; ?>" />
	     <input type="hidden" name="catid" value="<?php echo $values['catid']; ?>" />
        <input type="hidden" name="do" value="<?php echo $values['do']; ?>" /> /-->
        <table border="0" cellpadding="0" cellspacing="0" >
          <tr>
            <td class="label"><? echo get_bild(3,$content["image_name"],"Width","Height"); 
					    echo $values['id']; ?>				</td>
          </tr>
        </table>
      </form></td>
	 <td colspan="3">&nbsp;</td>
  </tr>
  <tr>
  	<td colspan="9"><hr /></td>
  </tr>
  <tr>
    <td align="right"><label for="f_url">Image File</label></td>
    <td><input type="text" id="f_url" class="largelWidth" value="" /></td>
    <td rowspan="3" align="right">&nbsp;</td>
    <td align="right"><label for="f_width">Width</label></td>
    <td><input type="text" id="f_width" class="smallWidth" value="" onChange="javascript:checkConstrains('width');"/>    </td>
    <td rowspan="2" align="right"><img src="img/locked.gif" id="imgLock" width="25" height="32" alt="Constrained Proportions" /> </td>
    <td rowspan="3" align="right">&nbsp;</td>
    <td align="right"><label for="f_vert">V Space</label></td>
    <td><input type="text" id="f_vert" class="smallWidth" value="" /></td>
  </tr>
  <tr>
    <td align="right"><label for="f_alt">Alt</label></td>
    <td><input type="text" id="f_alt" class="largelWidth" value="" /></td>
    <td align="right"><label for="f_height">Height</label></td>
    <td><input type="text" id="f_height" class="smallWidth" value="" onChange="javascript:checkConstrains('height');"/>    </td>
    <td align="right"><label for="f_horiz">H Space</label></td>
    <td><input type="text" id="f_horiz" class="smallWidth" value="" /></td>
  </tr>
  <tr>
    <td colspan="2"></td>
    <td align="right"><label for="f_align">Align</label></td>
    <td colspan="2"><select size="1" id="f_align" title="Positioning of this image">
        <option value=""                             >Not Set</option>
        <option value="left"                         >Left</option>
        <option value="right"                        >Right</option>
        <option value="texttop"                      >Texttop</option>
        <option value="absmiddle"                    >Absmiddle</option>
        <option value="baseline" selected="selected" >Baseline</option>
        <option value="absbottom"                    >Absbottom</option>
        <option value="bottom"                       >Bottom</option>
        <option value="middle"                       >Middle</option>
        <option value="top"                          >Top</option>
      </select>    </td>
    <td align="right"><label for="f_border">Border</label></td>
    <td><input type="text" id="f_border" class="smallWidth" value="" /></td>
  </tr>
  <tr>
    <td colspan="4" align="right"><input type="hidden" id="orginal_width" />
      <input type="hidden" id="orginal_height" />
      <input type="checkbox" id="constrain_prop" checked="checked" onClick="javascript:toggleConstrains(this);" />    </td>
    <td colspan="5"><label for="constrain_prop">Constrain Proportions</label></td>
  </tr>
</table>
<!--// image properties -->
<div style="text-align: right;">
  <hr />
  <button type="button" class="buttons" onClick="return refresh();">Refresh</button>
  <button type="button" class="buttons" onClick="return onOK();">RelURL-OK</button>
  <button type="button" class="buttons" onClick="return onOKabs();">AbsURL-OK</button>
  <button type="button" class="buttons" onClick="return onCancel();">Cancel</button>
</div>
<input type="hidden" id="f_file" name="f_file" />
</form>
</body>
</html>
